package co.fitstart.entity.courseware.assessment;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIdentityReference;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;

import co.fitstart.entity.course.round.CourseRound;

/**
 * 
 * @author dan
 *
 */
@Entity
@Table(name = "student_assessment")
public class StudentAssessment {
    
    @Id
    @GeneratedValue
    private Long id;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
    @JsonIdentityReference(alwaysAsId=true)
    private CourseRound courseRound;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
    @JsonIdentityReference(alwaysAsId=true)
    private BasicData basicData;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
    @JsonIdentityReference(alwaysAsId=true)
    private PostureJoint postureJoint;
    
    /** 创建时间 */
    private Date createTime;
    
    @Column(name = "is_disabled")
    private boolean disabled;
    
    /**
     * 
     */
    public StudentAssessment() {
        
    }
    
    /**
     * 
     * @param courseRound
     * @param basicData
     * @param postureJoint
     */
    public StudentAssessment(CourseRound courseRound, BasicData basicData, PostureJoint postureJoint) {
        this.courseRound = courseRound;
        this.basicData = basicData;
        this.postureJoint = postureJoint;
        this.createTime = new Date();
        this.disabled = false;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the courseRound
     */
    public CourseRound getCourseRound() {
        return courseRound;
    }

    /**
     * @return the basicData
     */
    public BasicData getBasicData() {
        return basicData;
    }

    /**
     * @return the postureJoint
     */
    public PostureJoint getPostureJoint() {
        return postureJoint;
    }

    /**
     * @return the createTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param courseRound the courseRound to set
     */
    public void setCourseRound(CourseRound courseRound) {
        this.courseRound = courseRound;
    }

    /**
     * @param basicData the basicData to set
     */
    public void setBasicData(BasicData basicData) {
        this.basicData = basicData;
    }

    /**
     * @param postureJoint the postureJoint to set
     */
    public void setPostureJoint(PostureJoint postureJoint) {
        this.postureJoint = postureJoint;
    }

    /**
     * @param createTime the createTime to set
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

}
